﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/jui.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    公司
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="layout" class="noNavTab">
        <div id="navTab">
            <h2 class="contentTitle">
                公司</h2>

            <div class="pageHeader">
                <div class="searchBar">
                    <table class="searchContent">
                        <tbody>
                            <tr>
                                <th>机构：</th>
                                <td>
                                    <select id="tree">
                                        <option value="-1">请选择</option>
                                        <option value="0">总公司</option>
                                        <option value="1">分公司</option>
                                    </select>
                                </td>
                                <th>
                                    状态：
                                </th>
                                <td>
                                    <%Html.RenderPartial("~/Views/BaseLibrary/ForStates.ascx"); %>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button onclick="loadList(0)">
                                            查询</button>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <%
                string tname = "Sys_Company";
                string url = "/sysManage/list_1";
                string addurl_1 = "/sysManage/add_1?tree=0";
                string addurl_2 = "/sysManage/add_1?tree=1";
                string editurl = "/sysManage/edit_1/{id}";
            %>
            <div class="pageContent">
                <div class="panelBar">
                    <ul class="toolBar">
                        <li>
                            <a class="add" href='<%:addurl_1 %>'><span>添加总公司</span></a>
                        </li>
                        <li>
                            <a class="add" href='<%:addurl_2 %>'><span>添加分公司</span></a>
                        </li>
                        <li>
                            <a class="edit" href='<%:editurl %>' target="editblank" rel="ids"><span>修改</span></a></li>
                        <li>
                            <%= JUIResult.ReturnOpen(tname, url, "1")%></li>
                        <li>
                            <%= JUIResult.ReturnDel(tname, url, "1")%></li>
                        <li class="line">line</li>
                    </ul>
                </div>
                <div id="listDt" class="pageContent">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../../content/jui-normal.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/Scripts/pager.js"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            loadList(0);
        });
        function loadList(i) {
            var htmlname = "listDt";
            var pars = '';
            var name = "";
            var tree = Number($('#tree').val());
            
            if (tree >= 0) {
                pars += tree;
                name += "0_tree__0";
            }
            
            pars = encodeURI(pars);
            
            var tName = '<%= DencryptHelper.Encrypt("Sys_Company") %>';
            var control = "sysManage/company/List";
            var datebase = "1";
            var states = $('#states').val();
            list(htmlname, pars, name, tName, control, datebase, states);
        }
    </script>
</asp:Content>
